<?php
class Form_Admin_Category extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');
        $this->setAttrib('class','frmSmall');
    	
        // create new element
        $id = $this->createElement('hidden', 'cat_id');
        $id->setDecorators(array('ViewHelper'));
        $this->addElement($id);

        $dimValue = $this->createElement('text', 'cat_name');
        $dimValue->setLabel('Tên danh mục: ');
        $dimValue->setRequired(TRUE);
        $dimValue->setAttrib('size',256);
        $dimValue->addFilter('StripTags'); 
        $this->addElement($dimValue);
        
        $this->clearDecorators();
        $this->addDecorator('FormElements')
            ->addDecorator('Description', array('class' => 'frmSmall'))            
            ->addDecorator('Form');
            
        $this->setElementDecorators(array(
            array('ViewHelper'),
            array('Errors'),
            array('Description'),
            array('Label', array('separator'=>' ')),
            array('HtmlTag', array('tag' => 'p')),
        ));
        
        $submit = $this->createElement('submit','submit');
        $submit->setDecorators(array(
            array('ViewHelper'),
            array('Description'),
            array('HtmlTag', array('tag' => 'p', 'class'=>'btn')),
        ));
        $this->addElement($submit);     
    }
}
?>
